<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="content-script-type" content="text/javascript"/>
<meta name="version" content="neblog-1.0"/>
<title>hikerwu</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/tool.js"></script>
<style>
    .datain { width:100%; height:200px;}
    .dataout { width:100%; height:400px;overflow-x:scroll;}
</style>
</head>
<body>

<div class="right">
    <p>数据转换: {"id":"n_27912042706779","url":"http:\/\/url.cn\/3QTs0O","timestamp":1342000173}, +2 day,</p>
    <div>
    <li><div><textarea id="data_in" rows="5" class="datain"></textarea></div></li>
    <li>
        <button id="b_switch">-><-</button>
        <button id="b_reset">reset</button>
        <button id="b_clear">clear</button>
        <!--{section name=t loop=$out.data}-->
        <button id="b_func" s="<!--{$out.data[t]}-->"><!--{$out.data[t]}--></button>
        <!--{/section}-->
    </li>
    <li><div><textarea id="data_out" class="dataout" wrap="off"></textarea></div></li>
    </div>
</div>
<script type="text/javascript">
$().ready(function(){
    $("#b_switch").click(function(){
        var datain = $("#data_in").val();
        var dataout = $("#data_out").val();
        $("#data_in").val(dataout);
        $("#data_out").val(datain);
    });
    $("#b_clear").click(function(){
        $("#data_in").val('');
        $("#data_out").val('');
    });
    $("#b_reset").click(function(){
        $("button").attr('disabled', false);
        $("#data_out").val('');
    });
    $("[id='b_func']").click(function(){
        var obj = this;
        $(obj).attr( "disabled", true );
        var aid = $(this).parent().attr("title");
		var data = {};
        data['style'] = $(this).attr('s');
        data['datain'] = $("#data_in").val();
        var url = '/hiker/?m=Convert&a=convert';
        getUrlAndDo( data, url, function( result ) {
            $("#data_out").val(result['data']);
            $(obj).attr( "disabled", false );
		});
    });
});
</script>

</body>
</html>
